﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity.Framework;
using System.Data.Objects;

namespace Business.Operations
{
    public class EgitimOperation
    {
        private static HPDMASEntities db = new HPDMASEntities();

        public EgitimOperation()
        {

        }

        public static List<Egitim> EgitimGetAll()
        {
            var egitimListesi = db.Egitim.ToList();
            return egitimListesi;
        }

        public static Egitim EgitimGetByEgitimId(int egitimId)
        {
            var egitim = (from c in db.Egitim where c.EgitimID == egitimId select c).First();
            return egitim;
        }

        public static void EgitimDelete(int egitimId)
        {
            Egitim k = (from c in db.Egitim where c.EgitimID == egitimId select c).First();
            db.DeleteObject(k);
            db.SaveChanges();
        }
    }
}
